package com.ztesoft.controller.home;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import com.ztesoft.controller.BaseController;
import com.ztesoft.entity.User;
import com.ztesoft.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("home")
public class HomeController extends BaseController {

    @Reference(check=false)//启动消费者不检查服务者是否存在
    public UserService userService;

    @RequestMapping("")
    public String home() {
        User user = userService.selectUserById();
        return JSON.toJSONString(user);
    }
}
